************************************
* Replication file for:            *
*                                  *
* "From Economic Competition       *
* to Military Combat: Export       *
* Similarity and International     *
* Conflict" (main text)            *
*                                  *
* J. Tyson Chatagnier and Kerim    *
* Can Kavakli                      *
*                                  *
* Published in the Journal of      *
* Conflict Resolution              *
************************************

/* Load data */
use "export_similarity_data.dta", clear


***********************
* Main Text - Table 1 *
***********************

* main variables
local propsim_main		"l.exports l.lowerdep2015"  
local model				"main"

* controls
local controls  		"contig_dummy lndist l.pwin_cap l.jointdem l.s3un majmaj majmin l.rivalry both_europe dec_1 dec_2 dec_3"
local extra_controls	""

* 1st dependent variable - All MIDs
local dv		"mid_init mid_py*"
local dv_abbr	"a_"

*
logit `dv' `controls'	`propsim_main'	`extra_controls'  if ongoing ==0 	, cl(dyad_num) robust
	est store `dv_abbr'`model'

local extra_controls	"l.low_gdppc l.joint_gatt l.lower_open"
	
logit `dv' `controls'	`propsim_main'	`extra_controls'  if ongoing ==0 	, cl(dyad_num) robust
	est store `dv_abbr'`model'_extra


* 2nd dependent variable - Fatal MIDs
local dv		"fatal_init fatal_py*"
local dv_abbr	"f_"

local extra_controls	""

*
logit `dv' `controls'	`propsim_main'	`extra_controls'  if ongoing ==0 	, cl(dyad_num) robust
	est store `dv_abbr'`model'

local extra_controls	"l.low_gdppc l.joint_gatt l.lower_open"
	
logit `dv' `controls'	`propsim_main'	`extra_controls'  if ongoing ==0 	, cl(dyad_num) robust
	est store `dv_abbr'`model'_extra
	

* 3rd dependent variable - High-Hostility MIDs
local dv		"hihost_init hihost_py*"
local dv_abbr	"h_"

local extra_controls	""

*
logit `dv' `controls'	`propsim_main'	`extra_controls'  if ongoing ==0 	, cl(dyad_num) robust
	est store `dv_abbr'`model'

local extra_controls	"l.low_gdppc l.joint_gatt l.lower_open"
	
logit `dv' `controls'	`propsim_main'	`extra_controls'  if ongoing ==0 	, cl(dyad_num) robust
	est store `dv_abbr'`model'_extra	

	
* TABLE 1
esttab a_main* f_main* h_main*, b(3) se(3) stats(N ll aic) star(* 0.1 ** 0.05 *** 0.01) drop(*py* *dec*)	order(L.exports *lowerdep*) 													


***********************
* Main Text - Table 2 *
***********************

* Controls
local controls  		"contig_dummy lndist l.pwin_cap l.jointdem l.s3un majmaj majmin l.rivalry both_europe dec_1 dec_2 dec_3"
local extra_controls	""

* Main variables (Oil and Non-Oil goods)
local propsim_main	"l.lower_oildep2015 l.lower_nonoildep2015 l.oilexports l.nonoilexports"  
local model			"oil"

* 1st dependent variable - All MIDs
local dv		"mid_init mid_py*"
local dv_abbr	"a_"
*
logit `dv' `controls'	`propsim_main'	`extra_controls'  if ongoing ==0 	, cl(dyad_num) robust
	est store `dv_abbr'`model'

* 2nd dependent variable - Fatal MIDs
local dv		"fatal_init fatal_py*"
local dv_abbr	"f_"
*
logit `dv' `controls'	`propsim_main'	`extra_controls'  if ongoing ==0 	, cl(dyad_num) robust
	est store `dv_abbr'`model'

* 3rd dependent variable - High-Hostility MIDs
local dv		"hihost_init hihost_py*"
local dv_abbr	"h_"
*
logit `dv' `controls'	`propsim_main'	`extra_controls'  if ongoing ==0 	, cl(dyad_num) robust
	est store `dv_abbr'`model'


* Main variables (Strategic and Non-Strategic goods)
local propsim_main	"l.strat l.nonstrat l.stratexports l.nonstratexports"  
local model			"strat"

* 1st dependent variable - All MIDs
local dv		"mid_init mid_py*"
local dv_abbr	"a_"
*
logit `dv' `controls'	`propsim_main'	`extra_controls'  if ongoing ==0 	, cl(dyad_num) robust
	est store `dv_abbr'`model'

* 2nd dependent variable - Fatal MIDs
local dv		"fatal_init fatal_py*"
local dv_abbr	"f_"
*
logit `dv' `controls'	`propsim_main'	`extra_controls'  if ongoing ==0 	, cl(dyad_num) robust
	est store `dv_abbr'`model'

* 3rd dependent variable - High-Hostility MIDs
local dv		"hihost_init hihost_py*"
local dv_abbr	"h_"
*
logit `dv' `controls'	`propsim_main'	`extra_controls'  if ongoing ==0 	, cl(dyad_num) robust
	est store `dv_abbr'`model'
	

* Main variables (Raw and Manuf goods)
local propsim_main	"l.lower_raw l.lower_man l.rawexports l.manexports"  
local model			"rawmanuf"

* 1st dependent variable - All MIDs
local dv		"mid_init mid_py*"
local dv_abbr	"a_"
*
logit `dv' `controls'	`propsim_main'	`extra_controls'  if ongoing ==0 	, cl(dyad_num) robust
	est store `dv_abbr'`model'

* 2nd dependent variable - Fatal MIDs
local dv		"fatal_init fatal_py*"
local dv_abbr	"f_"
*
logit `dv' `controls'	`propsim_main'	`extra_controls'  if ongoing ==0 	, cl(dyad_num) robust
	est store `dv_abbr'`model'

* 3rd dependent variable - High-Hostility MIDs
local dv		"hihost_init hihost_py*"
local dv_abbr	"h_"
*
logit `dv' `controls'	`propsim_main'	`extra_controls'  if ongoing ==0 	, cl(dyad_num) robust
	est store `dv_abbr'`model'
	

* TABLE 2
esttab a_oil a_strat a_rawmanuf, b(3) se(3) stats(N ll aic) star(* 0.1 ** 0.05 *** 0.01) drop(*py* *dec*)	



	
